"""
拆包： 元组
"""

# 拆包
def result_num():
    """
    拆包
    :return:
    """
    return 100,23
good,count = result_num()

print(good)
print(count)

# 拆包字典

dict1 = {'name':'张三','age': 20}
a,b = dict1

#对字典进行拆包，取出来的是字典的key
print(a)
print(dict1[a])

print(b)
print(dict1[b])

# 5.2 交换变量
a = 10
b = 20

# 定义中间变量
c = 0
c = a
a = b
b = c
print(f'a = {a}')
print(f'b = {b}')

# 交换变量化简方法
c, d = 10, 20
c, d = d, c
print(f'c = {c}')
print(f'd = {d}')



